﻿using System;
using System.Web.UI.WebControls;
using Foxy.GridViewControls;

namespace Foxy.WebControls
{
    /// <summary>
    /// Class that model the event arguments when the row is checked
    /// </summary>
    public class RowCheckedEventArgs : EventArgs
    {
        /// <summary>
        /// Row that was been selected.
        /// </summary>
        public GridViewRow GridViewRow { get; set; }
        /// <summary>
        /// CheckBox that was been checked
        /// </summary>
        public CheckBox CheckBox { get; set; }

        public RowCheckedEventArgs() { }

        public RowCheckedEventArgs(GridViewRow gridViewRow) {
            this.GridViewRow = gridViewRow;
            this.CheckBox = (CheckBox) gridViewRow.FindControl(CheckBoxItem.CheckBoxID);
        }
    }

    public delegate void RowCheckedEventHandler(object sender, RowCheckedEventArgs e);
}
